<?php
/**
 * Repository.php
 * @copyright (c) 2011-2020, Hangzhou DOJI Tech Co., Ltd.
 * This is NOT a freeware, use is subject to license terms.
 * @package Repository.php
 * @link https://www.tingjunapp.com/
 * @author wujun@lanqb.cn
 * @: Repository.php 310000 2020-11-08 21:33:54 $
 * */

namespace App\Repository;

/**
 * Class Repository
 * @package App\Repository
 * #Repository List:
 * @property AgreementRepository $AgreementRepository
 * @property ArticleRepository $ArticleRepository
 * @property CollectRepository $CollectRepository
 * @property CommentRepository $CommentRepository
 * @property DynamicRepository $DynamicRepository
 * @property FeedbackRepository $FeedbackRepository
 * @property HomeRepository $HomeRepository
 * @property IndustryRepository $IndustryRepository
 * @property InterRepository $InterRepository
 * @property JobRepository $JobRepository
 * @property LikeRepository $LikeRepository
 * @property MessageRepository $MessageRepository
 * @property NoteRepository $NoteRepository
 * @property PackageRepository $PackageRepository
 * @property ProCategoryRepository $ProCategoryRepository
 * @property ProRepository $ProRepository
 * @property QuickRepository $QuickRepository
 * @property RelationshipRepository $RelationshipRepository
 * @property ReplyRepository $ReplyRepository
 * @property ReportRepository $ReportRepository
 * @property SearchRepository $SearchRepository
 * @property ShareRepository $ShareRepository
 * @property SiteRepository $SiteRepository
 * @property SmsRepository $SmsRepository
 * @property SquareRepository $SquareRepository
 * @property UserRepository $UserRepository
 *
 * #Repository end.
 * @return Repository
 */
class Repository
{

    /**
     * Repository constructor.
     */
    public function __construct()
    {
        // construction
    }

    /**
     * Handle dynamic static method calls into the model.
     * @param  string  $method
     * @param  array  $parameters
     * @return mixed
     */
    public static function __callStatic($method, $parameters)
    {
        return (new static)->$method(...$parameters);
    }

    /**
     * Convert the model to its string representation.
     * @return string
     */
    public function __toString()
    {
        return json_encode($this);
    }

    /**
     * Get property in instance.
     * @param $property
     * @return mixed|null
     */
    public function __get($property)
    {
        if (isset($this->$property)) {
            return $this->$property;
        } else {
            $instance = 'App\\Repository\\'.$property;
            return new $instance();
        }
    }

    /**
     * Set property for instance.
     * @param $property
     * @param $value
     */
    public function __set($property, $value)
    {
        $this->$property = $value;
    }

    /**
     * Deny clone instance.
     * @return null
     */
    public function __clone()
    {
        return null;
    }

}
